doctype html
html
  head
    //meta(name="viewport").viewport
    title= title
    link(rel='stylesheet', href='/swiper/css/swiper.min.css')
    link(rel='stylesheet', href='/stylesheets/displayDoc.css')
    script(src='http://7xogoq.com1.z0.glb.clouddn.com/itbserver/api/js/jquery-1.11.0.min.js')
    script(src='http://7xogoq.com1.z0.glb.clouddn.com/itbserver/api/swiper/js/swiper.min.js')
    script(src='http://7xogoq.com1.z0.glb.clouddn.com/itbserver/api/js/jweixin-1.0.0.js')
    //script(src='/javascripts/SJGMediaPlayer.js')
  body
    block content
      div.mask
        img(src="http://7xogoq.com1.z0.glb.clouddn.com/itbserver/api/img/mask.png")#screen_mask.screen_mask
        if (typeFlg==1 || typeFlg=="1")
          div(onclick="onClickDisplay()").disp_icon.disp_play
            img(src="http://7xogoq.com1.z0.glb.clouddn.com/itbserver/api/img/MainPlay.png")
          div(onclick="onClickDisplay()").disp_icon_l.disp_replay.display_hide
            img(src="http://7xogoq.com1.z0.glb.clouddn.com/itbserver/api/img/card/replay.png")
          div(onclick="onClickMake()").disp_icon_r.disp_replay.display_hide
            img(src="http://7xogoq.com1.z0.glb.clouddn.com/itbserver/api/img/card/remake.png")
        else
          div(onclick="onClickDisplay()").disp_icon.disp_play
            img(src="http://7xogoq.com1.z0.glb.clouddn.com/itbserver/api/img/MainPlay.png")
          div(onclick="onClickDisplay()").disp_icon.disp_replay.display_hide
            img(src="http://7xogoq.com1.z0.glb.clouddn.com/itbserver/api/img/MainReplay.png")
        img(src="http://7xogoq.com1.z0.glb.clouddn.com/itbserver/api/img/LOGO.png").logo

      div.mask2.display_hide
        img(src="http://7xogoq.com1.z0.glb.clouddn.com/itbserver/api/img/mask.png")#load_mask.load_mask
        img(src="http://7xogoq.com1.z0.glb.clouddn.com/itbserver/api/img/loading.png").load_img

      - var titleNm = doc_name || '文稿展示'
      h1#h1Name.display_hide=titleNm

      div(onclick="onMusicClick()").music
        span.icon-music.music_play
        //audio#aud(src='' onended="onMusicEnded()")
      div#video.video.display_hide
        //video#vid(src='' preload="none" webkit-playsinline width="320px" height="180px")
        canvas#vid_canv

      div.swiper-container.gallery-top
        div.swiper-wrapper
          each page in pages
            if(page.thumb_s)
              div.swiper-slide
                - var imgParam = '?imageView2/0/w/960/h/540'
                - if (platform == "desktop") imgParam = '?imageView2/0/w/1600/h/900'
                img(id='img'+page.page_index src=page.thumb_s + imgParam)
                - var audioUrl= ""
                - if (page.audio && page.audio.length>0) audioUrl = JSON.parse(page.audio).url
                input(type="hidden" id='urlAud'+page.page_index value=audioUrl)
                //input(type="hidden" id='urlVid'+page.page_index value=page.video)
        div.swiper-button-next.swiper-button-white
        div.swiper-button-prev.swiper-button-white
        div.swiper-pagination

      //div.swiper-container.gallery-thumbs
      //  div.swiper-wrapper
      //    each page in pages
      //      if(page.thumb_s)
      //        - var imgId = 'img'+page.page_index
      //        div.swiper-slide
      //          img(id=imgId src=page.thumb_s + '?imageView2/0/w/480/h/270')

      //script(src='http://7xogoq.com1.z0.glb.clouddn.com/itbserver/api/js/jquery-1.11.0.min.js')
      //script(src='http://7xogoq.com1.z0.glb.clouddn.com/itbserver/api/swiper/js/swiper.min.js')
      //script(src='http://7xogoq.com1.z0.glb.clouddn.com/itbserver/api/js/jweixin-1.0.0.js')
      script(type='text/javascript').
        var gPagesJson = !{pagesJsonStr};
        var gMediaPos = #{mediaPos};
        var gMediaFlg = #{mediaFlg};
        var gAPIHOST = '#{api_host}';
        var gIsPortrait = false;
        var gShareIcon ='http://7xogoq.com1.z0.glb.clouddn.com/itbserver/api/img/logo60-3X.png';
        var gImg0 = document.getElementById('img0');
        if (gImg0) {
          gShareIcon = gImg0.src;
        }
        var gWechat = !{wechat};
        var gURL = gWechat.url;
        wx.config({
          debug: false,
          appId: gWechat.appId,
          timestamp: gWechat.timestamp,
          nonceStr: gWechat.nonceStr,
          signature: gWechat.signature,
          jsApiList: [
            'checkJsApi',
            'onMenuShareTimeline',
            'onMenuShareAppMessage'
          ]
        });
      script(src='/javascripts/SJGMediaPlayer.js')
      script(src = '/javascripts/displayDoc.js')
